package day0530;

import java.util.Scanner;

public class File9 {

    //让本文件能运行
    public static void main(String[] args) {
        //1.输入小时数据
        Scanner  s=new Scanner(System.in);
        System.out.println("请输入当前的小时数据：");
        int hour=s.nextInt();//用s.nextInt()输入int数据存入hour中
        if(0<hour  && hour<=12){
            System.out.println(hour+"am");
        }else  if(12<hour  && hour<=24){
            System.out.println(hour-12+"pm");
        }else {
            System.out.println("您输入的数据无效");
        }
    }

}









